#include <deque>
#include <iostream>
#include <ostream>
#include <queue>
#include <set>
#include <vector>
using ll = long long;

ll n,m,k,ans;
const ll max_n = 10000;
std::vector<ll> next[max_n];
ll score[max_n];
// #define ONLINE_JUDGE
#ifdef ONLINE_JUDGE
    #define DEBUG(code)
#else
    #define DEBUG(code)code
#endif


template<class T>
std::ostream &operator<<(std::ostream &os,const std::vector<T> &t){
    os<<"vector { ";
    if(t.size()>0){
        for(ll i{0};i<t.size()-1;i++){
            os<<t[i]<<", ";
        }
        os<<*t.rbegin();
    }
    os<<" }";
    return os;
}

template<class T>
std::ostream &operator<<(std::ostream &os,const std::set<T> &t){
    os<<"set { ";
    auto it = t.begin();
    if(t.size()>0){
        while(*it!=*t.rbegin()){
            os<<*it++<<", ";
        }
        os<<*t.rbegin();
    }
    os<<" }";
    return os;
}

template<class T>
std::ostream &operator<<(std::ostream &os,const std::deque<T> &t){
    os<<"deque { ";
    for(ll i{0};i<(ll)t.size()-1;i++){
        os<<t[i]<<", ";
    }
    if (t.size()!=0) {
        os<<*t.rbegin();
    }
    os<<" }";
    return os;
}

struct State{
    ll now,step,used_k,score;
    std::set<ll>vis;
    DEBUG(
        std::vector<ll> his;
    )
    bool operator<(const State &that)const{
        return this->score>that.score;
    }
    friend std::ostream&operator<<(std::ostream &os, State const &s){
        os<<"State { now: "<<s.now<<", step: "<<s.step<<", used_k: "<<s.used_k<<", score:"<<s.score<<", vis: "<<s.vis DEBUG(<<", his:"<<s.his)<<" }";
        return os;
    }
};
std::priority_queue<State> q;
DEBUG(
    State last_state;
)



int main(){
    std::cin>>n>>m>>k;
    for(ll i{2};i<=n;i++){
        std::cin>>score[i];
    }
    for(ll i{1};i<=m;i++){
        ll u,v;
        std::cin>>u>>v;
        next[u].push_back(v);
        next[v].push_back(u);
    }
    DEBUG(
        std::cout<<next[4]<<'\n';
    )
    for(const auto i:next[1]){
        std::vector<ll> new_his {1,i}; 
        std::set<ll> s;
        s.insert(i);
        // q.push({i,1,0,score[i],DEBUG(new_his),});
        q.push({.now=i, .step=1, .used_k=0, .score=score[i], .vis=s, DEBUG(.his=new_his)});
        new_his[1] = -new_his[1];
        q.push({.now=i, .step=0, .used_k=1, .score=0, DEBUG(.his=new_his)});
    }
    while(!q.empty()){
        const auto front = q.top();
        q.pop();
        DEBUG(std::cout<<front<<'\n';)
        DEBUG(
            if(front.now==5){
                std::cout<<front<<'\n';
            }
        )
        if(front.step==4){
            if(front.now==1){
                if(ans<front.score){
                    ans = front.score;
                    DEBUG(
                        last_state = front;
                    )
                }
            }
            continue;
        }
        for(const auto i:next[front.now]){
            if(front.vis.find(i)!=front.vis.end()){
                continue;
            }
            auto new_vis = front.vis;
            new_vis.insert(i);
            DEBUG(
                auto old_his = front.his;
                old_his.push_back(i);
            )
            q.push({.now=i, .step=front.step+1, .used_k=0, .score=front.score+score[i], .vis=new_vis, DEBUG(.his=old_his)});
        }
        if(front.used_k>=k){
            continue;
        }
        for(const auto i:next[front.now]){
            DEBUG(
                auto old_his = front.his;
                old_his.push_back(-i);
            )
            DEBUG(
                if(front.now==3){
                    std::cout<<next[3]<<'\n';
                }
            )
            q.push({.now=i, .step=front.step, .used_k = front.used_k+1, .score=front.score,.vis=front.vis ,DEBUG(.his=old_his)});
        }
    }
    std::cout<<ans<<'\n';
    DEBUG(
        std::cout<<'\n';
        std::cout<<last_state<<'\n';
    )
}